The present invention generally relates to keyboards and, more particularly, to apparatus and methods of ordering the sending of scan codes in keyboards.
Computer keyboards—such as for laptops, notebooks, desktops, mobile phones—may include control circuitry to convert key presses into scan codes. A scan code is data that computer keyboards send to a computer to report which key has been pressed. A number, or sequence of numbers, is assigned to each key on the keyboard. Key switches are connected via a printed circuit board in an electrical X-Y matrix where a voltage is provided sequentially to the Y lines and, when a key is depressed, detected sequentially by scanning the X lines, or vice versa.
In most typing, only one key is pressed at a time and then released before the next key is pressed. However, in some instances, multiple keys may be pressed simultaneously or very quickly in sequence. This often occurs, for example, in gaming.
FIG. 1A depicts a conventional keyboard matrix 10. Drive or input lines are the columns, while detection or sense lines are the rows. Matrix scanning can start from A1 and proceed to G7, or vice versa, but not both. During use, for example, keys C4 and F5 may be pressed simultaneously or very quickly in sequence. Upon receipt of key pressing signals from the matrix 10, a keyboard integrated circuit 11 (i.e., embedded controller (EC)) can send scan codes, in a particular order, to the central processing unit 12.
In FIG. 1A, if the matrix scanning starts from A1 and proceeds to G7, the scan codes will be sent in the order of C4, F5. On the other hand, if the matrix scanning starts from G7 and proceeds to A1, the scan codes will be sent in the order of F5, C4. Whichever the scanning direction, the direction is fixed. Thus, the order of sending the scan codes is fixed. But this fixed order may be an incorrect order for a given circumstance. In other words, as an example, the keys may have been pressed in the order of C4, F5, but due to the scanning direction, the scan codes may be sent in the order of F5, C4.
FIG. 1B depicts another potential problem in the keyboard matrix 10 when two or more keys in the same drive line are pressed, during a single scan cycle, sequentially. A scan cycle is a period during which each drive line is scanned once in sequence. Accordingly, for example, a scanning cycle may start at drive line 1 and end at drive line 7. As a further example, it may take 0.5 milliseconds to scan each drive line.
Thus, in FIG. 1B, during an exemplary use of keyboard matrix 10, drive line 1 is scanned from A to G, and then 0.5 milliseconds later, drive line 2 is scanned from A to G, and so on. If, for example, during the scan of drive line 7, C6 is pressed. When drive lines 1-4 are scanned after drive line 7, 2.0 milliseconds have passed since drive line 7 was scanned. During the scan of drive line 5, for example, D6 is pressed, in the single scan cycle that started at drive line 7. When drive line 6 is scanned, the matrix 10 determines that C6 and D6 have been pressed. But because the keys were pressed during the same scan cycle and in the same drive line, the matrix 10 cannot discern whether C6 or D6 was pressed first. Accordingly, the scan codes may be sent incorrectly as D6, C6 rather than C6, D6. This results from having a fixed order of sending scan codes.
As can be seen, there is a need for improved apparatus and methods to order the sending of scan codes in keyboards.